package com.arrlist;

import java.util.ArrayList;
import java.util.List;

public class ArrayListStudents {
    public static void main(String[] args) {
        List<Students> students = new ArrayList<Students>();

        Students students1 = new Students("老张",12);
        Students students2 = new Students("老张2",112);

        students.add(students1);
        students.add(students2);

        for(int i=0;i<students.size();i++){
            System.out.println(students.get(i).getName());
        }
    }
}
